# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kalarm
pkgver=20.04.3
pkgrel=0
arch="all !ppc64le !s390x !armhf !mips !mips64" # Limited by kmailtransport -> libkgapi -> qt5-qtwebengine
url="https://kontact.kde.org/"
pkgdesc="Personal alarm scheduler"
license="GPL-2.0-or-later AND GFDL-1.2-only"
depends="kdepim-runtime"
makedepends="extra-cmake-modules qt5-qtbase-dev qt5-qtx11extras-dev kauth-dev kcodecs-dev kcompletion-dev kconfig-dev kconfigwidgets-dev kdbusaddons-dev kdoctools-dev kglobalaccel-dev kguiaddons-dev ki18n-dev kiconthemes-dev kjobwidgets-dev kcmutils-dev kdelibs4support-dev kio-dev knotifications-dev kservice-dev kwidgetsaddons-dev kwindowsystem-dev kxmlgui-dev kholidays-dev phonon-dev kimap-dev akonadi-dev akonadi-contacts-dev akonadi-mime-dev kalarmcal-dev kcalendarcore-dev kcalutils-dev kidentitymanagement-dev kdepim-apps-libs-dev libkdepim-dev mailcommon-dev kmailtransport-dev kmime-dev pimcommon-dev kpimtextedit-dev libxslt-dev qgpgme"
source="https://download.kde.org/stable/release-service/$pkgver/src/kalarm-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="a8665a16d6a35790778596965819f25ca47c93887f515439a143a332bf129f699eb42e85d11da6cd737c63f81c380c6b93870105c87f59d1e9c8106e6694a282  kalarm-20.04.3.tar.xz"
